import 'dart:convert' show json;

class DancerMD {

  int? cursor;
  int? err;
  String? err_msg;
  String? token;
  MDContent? md;

  DancerMD.fromParams({this.cursor, this.err, this.err_msg, this.token, this.md});

  factory DancerMD(Object jsonStr) => jsonStr is String ? DancerMD.fromJson(json.decode(jsonStr)) : DancerMD.fromJson(jsonStr);

  static DancerMD? parse(jsonStr) => ['null', '', null].contains(jsonStr) ? null : DancerMD(jsonStr);

  DancerMD.fromJson(jsonRes) {
    cursor = jsonRes['cursor'];
    err = jsonRes['err'];
    err_msg = jsonRes['err_msg'];
    token = jsonRes['token'];
    md = jsonRes['data'] == null ? null : MDContent.fromJson(jsonRes['data']);
  }

  @override
  String toString() {
    return '{"cursor": $cursor, "err": $err, "err_msg": ${err_msg != null?'${json.encode(err_msg)}':'null'}, "token": ${token != null?'${json.encode(token)}':'null'}, "data": $md}';
  }

  String toJson() => this.toString();
}

class MDContent {

  String? content;

  MDContent.fromParams({this.content});

  MDContent.fromJson(jsonRes) {
    content = jsonRes['content'];
  }

  @override
  String toString() {
    return '{"content": ${content != null?'${json.encode(content)}':'null'}}';
  }

  String toJson() => this.toString();
}